package cn.hotel.event;

import cn.hotel.entity.Order;
import cn.hotel.service.OrderService;
import org.springframework.context.ApplicationEvent;

import javax.annotation.Resource;
import java.util.Timer;
import java.util.TimerTask;

/**
 * 用于定时删除未支付的订单
 */
public class OrderCreateEvent extends ApplicationEvent {

    private  Order order;
    @Resource
    private OrderService orderService;

    /**
     * 用于定时将未支付的订单删除
     * @param source
     * @param order
     */
    public OrderCreateEvent(Object source,Order order) {
        super(source);
        this.order=order;
    }

    public Order getOrder() {
        return order;
    }
}
